#include "SinglyList.h"

void test1() {
    SListNode* list = BuySListNode(1);
    SListPushBack(&list, 2);
    SListPushFront(&list, 3);
    SListPrint(list);
    SListDistory(&list);
}

void test2() {
    SListNode* list = NULL;
    SListPushBack(&list, 2);
    SListPopBack(&list);
    SListPrint(list);
    SListDistory(&list);
}

void test3() {
    SListNode* list = NULL;
    SListPushBack(&list, 2);
    SListPushBack(&list, 3);
    SListPopFront(&list);
    SListPrint(list);
    SListDistory(&list);
}

void test4() {
    SListNode* list = NULL;
    SListPushBack(&list, 2);
    SListPushBack(&list, 3);
    SListPushBack(&list, 4);
    SListPushBack(&list, 5);
    SListPushBack(&list, 6);
    SListPrint(list);

    SListFind(list, 2);
    SListNode* a = SListFind(list, 4);

    SListInsertAfter(a, 7);

    SListFind(list, 6);
    SListFind(list, 1);
    SListPrint(list);
    SListEraseAfter(a);
    SListPrint(list);
    SListDistory(&list);
}

int main() {
    test1();
    test2();
    test3();
    test4();
    return 0;
}